package com.mm.vo.web.user;

import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述: 权限树形表格VO
 *
 * @author: yanglin
 * @Date: 2021-08-10-16:36
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PermissionTreeVo {

    /**
     * 节点ID
     */
    public Integer id;

    /**
     * 父节点ID
     */
    public Integer pid;

    /**
     * 父节点ID字符串(多层级)
     */
    public String pParentIds;

    /**
     * 权限类型 menu button
     */
    public String pType;

    /**
     * 菜单名称
     */
    public String title;

    /**
     * 权限路径
     */
    public String pUrl;

    /**
     * 权限规则 user:add
     */
    public String pRule;

    /**
     * 权限是否可用 0-true 1-false
     */
    public Integer pAvailable;

    /**
     * 权限请求类型 POST/GET/DELETE
     */
    public String pReqType;

    /**
     * 权限备注
     */
    public String pRemark;

    /**
     * 子集
     */
    public List<PermissionTreeVo> children = new ArrayList<>();

    @Builder
    public PermissionTreeVo(Integer id, Integer pid, String pParentIds, String pType, String title, String pUrl, String pRule, Integer pAvailable, String pReqType, String pRemark, List<PermissionTreeVo> children) {
        this.id = id;
        this.pid = pid;
        this.pParentIds = pParentIds;
        this.pType = pType;
        this.title = title;
        this.pUrl = pUrl;
        this.pRule = pRule;
        this.pAvailable = pAvailable;
        this.pReqType = pReqType;
        this.pRemark = pRemark;
        this.children = children;
    }
}
